@echo off
cd ..
set protoSourcePath=%cd%\protobuf\extensions\
set protoImportsPath=%cd%

cd csharptool
set protoBinPath=%cd%\protobins\
set csharpSourceOutputPath=%cd%\csharpCodes\
set csharpProjectPath=%cd%\ProtoDllGen\ProtoTest\protobufs\
::for %%i in (*.*) do echo %%i 
echo generateing csharp codes...

for %%i in (%protoSourcePath%*.*) do (
	%cd%\protoc.exe --descriptor_set_out=%protoBinPath%%%~ni.protobin --include_imports %%i --proto_path=%protoImportsPath%
	%cd%\protogen.exe %protoBinPath%%%~ni.protobin -output_directory=%csharpSourceOutputPath%
	 )
echo copying csharp code file to project..
copy %csharpSourceOutputPath%*.cs %csharpProjectPath%
C:\Windows\Microsoft.NET\Framework64\v3.5\csc /target:library /out:ProtoDll.dll /recurse:ProtoDllGen\ProtoTest\protobufs\*.cs /r:ProtoDllGen\ProtoTest\Google.ProtocolBuffersLite.dll
pause